package com.rest.demo.io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

/**
 * @author Administrator
 * @decription
 * @Date 2018-02-05 14:36
 */
public class ReaderDemo {
    public static void main(String[] args) {
        Reader reader = null;
        try {
            reader = new FileReader("F:\\out.txt");
            char[] buff = new char[1024];
            int c = -1;
            while((c = reader.read(buff)) != -1) {
                System.out.println(new String(buff,0,c));
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
